<%--
  Created by IntelliJ IDEA.
  User: xiaoji
  Date: 2014/12/15
  Time: 15:50
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="spring" uri="/WEB-INF/lib/spring.tld"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title><spring:message code='usercenter.index.title' /></title>
    <link href="${path}/style/acg/css/style.css" rel="stylesheet" type="text/css" />
    <script src="${path}/js/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<jsp:include page="../public/header.jsp">
    <jsp:param    name="usercenter"    value="true"    />
</jsp:include>
<jsp:include page="../usercenter/leftMenu.jsp"></jsp:include>

<div class="member_box">
    <div class="member_title">
        <ul>
            <li class="hover"><a href="javascript:void(0);"><spring:message code='usercenter.promote.msg1' /></a></li>
        </ul>
    </div>
    <div class="member_account">
        <div class="member_form">
            <ul>
                <li class="clearfix">
                    <dl class="clearfix">
                        <dt>&nbsp;</dt>
                        <dd>
                            <%--<input type="text" id="txt" name="txt" value="${pageContext.request.scheme}${'://'}${pageContext.request.serverName}${':'}${pageContext.request.serverPort}${pageContext.request.contextPath}/register/toRegister.html?id=${sessionScope.curUser.userId}" class="txtorg" />--%>
                                <input type="text" id="txt" name="txt" value="${pageContext.request.scheme}${'://'}waibao51.com/register/toRegister.html?id=${sessionScope.curUser.userId}" class="txtorg" />
                            <input type="button" id="" name="" value="<spring:message code='usercenter.promote.msg2' />" class="btngorg" onclick="copyToClipboard(document.getElementById('txt').value);"/></dd>
                    </dl>
                </li>
                <li class="clearfix">
                    <dl class="clearfix">
                        <dt>&nbsp;</dt>
                        <dd><spring:message code='usercenter.promote.msg3' /><em class="color_red">${total}</em><spring:message code='usercenter.promote.msg4' /></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    // <![CDATA[
    function copyToClipboard(maintext){
        if (window.clipboardData){
            window.clipboardData.setData("Text", maintext);
            alert("<spring:message code='usercenter.promote.msg5' />");
        }else if (window.netscape){
            try{
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }catch(e){
                alert("<spring:message code='usercenter.promote.msg6' />");
            }
            var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
            if (!clip) return;
            var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
            if (!trans) return;
            trans.addDataFlavor('text/unicode');
            var str = new Object();
            var len = new Object();
            var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
            var copytext=maintext;
            str.data=copytext;
            trans.setTransferData("text/unicode",str,copytext.length*2);
            var clipid=Components.interfaces.nsIClipboard;
            if (!clip) return false;
            clip.setData(trans,null,clipid.kGlobalClipboard);
            alert("<spring:message code='usercenter.promote.msg5' />");
        }else{
            alert("<spring:message code='usercenter.promote.msg6' />");
        }
    }
    // ]]>
</script>
<jsp:include page="../usercenter/leftMenuEnd.jsp"></jsp:include>
<jsp:include page="../public/footer.jsp"></jsp:include>
</body>
</html>
